//
//
//  @ Project : AgriMarketSystem
//  @ Date : 18/10/2013
//  @ Author : NTT
//
//

using System.Collections.Generic;
using System.Linq;
namespace AgriMarketService
{
    public class TypeOfProduct
    {
        public int typeId;
        public string typeName;
        public static TypeOfProduct GetTypeById(int typeId)
        { 
            List<TypeOfProduct> allTypes=GetAllTypes();
            TypeOfProduct type = (from tempType in allTypes where tempType.typeId == typeId select tempType).FirstOrDefault();
            return type;
        }
        public static List<TypeOfProduct> GetAllTypes()
        {
            return new List<TypeOfProduct>() {
                new TypeOfProduct(){typeId=1,typeName="Type of product 1"},
                new TypeOfProduct(){typeId=2,typeName="Type of product 2"},
                new TypeOfProduct(){typeId=3,typeName="Type of product 3"},
                new TypeOfProduct(){typeId=4,typeName="Type of product 4"},
                new TypeOfProduct(){typeId=5,typeName="Type of product 5"},
                new TypeOfProduct(){typeId=6,typeName="Type of product 6"}
            };
        }
    }
}
